﻿using System;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            //2个double类型数据的运算
            Console.Write("请输入第一个数字：");
            String a = Console.ReadLine();

            Console.Write("请输入第二个数字：");
            String b = Console.ReadLine();

            Console.Write("请输入运算符：");
            String o = Console.ReadLine();

            double result = 0.0;
            switch (o)
            {
                case "+":
                    result = Double.Parse(a) + Double.Parse(b);
                    break;
                case "-":
                    result = Double.Parse(a) - Double.Parse(b);
                    break;
                case "*":
                    result = Double.Parse(a) * Double.Parse(b);
                    break;
                case "/":
                    result = Double.Parse(a) / Double.Parse(b);
                    break;
                default:
                    Console.WriteLine("非法输入");
                    return;
            }

            Console.WriteLine($"{a} {o} {b} = {result}");
        }
    }
}
